package drds.binlog.parse.inbound;

import org.apache.commons.lang.StringUtils;


public class FieldMetaData
{

    private String columnName;
    private String columnType;
    private boolean nullable;
    private String defaultValue;
    private boolean primaryKey;
    private boolean uniqueKey;
    private String extra;


    public FieldMetaData()
    {

    }

    public FieldMetaData(String columnName, String columnType, boolean nullable, String defaultValue, boolean primaryKey)
    {
        this.columnName = columnName;
        this.columnType = columnType;
        this.nullable = nullable;
        this.defaultValue = defaultValue;
        this.primaryKey = primaryKey;
    }

    public String getColumnName()
    {
        return columnName;
    }

    public void setColumnName(String columnName)
    {
        this.columnName = columnName;
    }

    public String getColumnType()
    {
        return columnType;
    }

    public void setColumnType(String columnType)
    {
        this.columnType = columnType;
    }

    public String getDefaultValue()
    {
        return defaultValue;
    }

    public void setDefaultValue(String defaultValue)
    {
        this.defaultValue = defaultValue;
    }

    public boolean isUnsigned()
    {
        return StringUtils.containsIgnoreCase(columnType, "unsigned");
    }

    public boolean isNullable()
    {
        return nullable;
    }

    public void setNullable(boolean nullable)
    {
        this.nullable = nullable;
    }

    public boolean isPrimaryKey()
    {
        return primaryKey;
    }

    public void setPrimaryKey(boolean primaryKey)
    {
        this.primaryKey = primaryKey;
    }

    public String getExtra()
    {
        return extra;
    }

    public void setExtra(String extra)
    {
        this.extra = extra;
    }

    public boolean isUniqueKey()
    {
        return uniqueKey;
    }

    public void setUniqueKey(boolean uniqueKey)
    {
        this.uniqueKey = uniqueKey;
    }


}
